package com.ktkj.init.enums;


/**
 * 季节 枚举类.
 *
 * @author :yanlixiong
 * @date :2021-11-26 16:55:20
 */
public enum SeasonType {
    SPRING(1, "春"),
    SUMMER(2, "夏"),
    AUTUMN(3, "秋"),
    WINTER(4, "冬");

    private Integer code;
    private String desc;

    SeasonType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static SeasonType getSeasonType(int code) {
        for (SeasonType seasonType : SeasonType.values()) {
            if (code == seasonType.getCode().intValue()) {
                return seasonType;
            }
        }
        return null;
    }
}
